package demo12;

import java.util.ArrayList;
import java.util.Arrays;

public class Test01 {
    public static void main(String[] args) {
        Employee e1=new Employee("小明",1800);
        Employee e2=new Employee("小新",2600);
        ArrayList<Employee>list=new ArrayList<>();
        list.add(e1);
        list.add(e2);
        for (Employee employee : list) {
            if (employee.getName().equals("小明")){
                employee.setSalary(employee.getSalary()+300);
            }
        }
        for (Employee employee : list) {
            System.out.println(employee);
        }
    }
}
